package 字节;

/**
 * @author zhangmin
 * @create 2022-04-06 13:56
 */
public class 面试0406 {
    public static void main(String[] args) {
        int[] nums=new int[]{4,9,3,10,7};
        int k=5;
        double left=0,right=Integer.MIN_VALUE;
        for (int i = 0; i < nums.length; i++) {
            right=Math.max(right,nums[i]);
        }
        while (right-left>1e-8){
            double mid=(left+right)/2;
            int count=0;
            for (int i = 0; i < nums.length; i++) {
                count+=nums[i]/mid;
            }
            if (count>=k){
                left=mid;
            }else {
                right=mid;
            }
        }
        System.out.println(String.format("%.1f",left));
    }
}
